/*
 * @Date         : 2024-05-17 10:59:25 星期5
 * @Author       : xut
 * @Description  :
 */
import path from "node:path"
import "dotenv/config"

export interface EnvConfig {
  port: number
  accessTokenExpiresIn: number
  refreshTokenExpiresIn: number
  accessTokenPrivateKey: string
  accessTokenPublicKey: string
  refreshTokenPrivateKey: string
  refreshTokenPublicKey: string
  redisCacheExpiresIn: number
  emailFrom: string
  smtp: {
    host: string
    pass: string
    port: string
    user: string
  }
}

export const envConfig: EnvConfig = {
  port: 9000,
  accessTokenExpiresIn: 15,
  refreshTokenExpiresIn: 60,
  redisCacheExpiresIn: 60,
  accessTokenPrivateKey: process.env.ACCESS_TOKEN_PRIVATE_KEY as string,
  accessTokenPublicKey: process.env.ACCESS_TOKEN_PUBLIC_KEY as string,
  refreshTokenPrivateKey: process.env.REFRESH_TOKEN_PRIVATE_KEY as string,
  refreshTokenPublicKey: process.env.REFRESH_TOKEN_PUBLIC_KEY as string,
  emailFrom: process.env.EMAIL_FROM as string,
  smtp: {
    host: process.env.SMTP_HOST as string,
    pass: process.env.SMTP_PASS as string,
    port: process.env.SMTP_PORT as string,
    user: process.env.SMTP_USER as string,
  },
}
